<?php
//Nullsafe运算符 ？-》

class Test
{
    public $str = '';

    public function name($table= '')
    {
       if($table == null){
          return null;
       }
       $this->str = $this->str.$table;
       return $this;
    }
    public function find($field = '')
    {
        if($field == null){
            return null;
        }
       return $this->str = $this->str.$field;
    }
}


$obj =new Test();
//$result = $obj?->name()?->find(); 	      // 安全调用方法链
$result = $obj?->name('user')?->find('name'); 	      // 安全调用方法链
var_dump($result);